﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions.tracking {
    import Engine.Transactions.*;

    public class ResourceState {

        private var m_energy:Number = 0;
        private var m_gold:Number = 0;
        private var m_xp:Number = 0;
        private var m_cash:Number = 0;

        public static function getClientState():ResourceState{
            var _local1:ResourceState = new (ResourceState)();
            _local1.energy = Global.player.energy;
            _local1.gold = Global.player.gold;
            _local1.xp = Global.player.xp;
            _local1.cash = Global.player.cash;
            return (_local1);
        }
        public static function getInitialServerState(_arg1:Transaction):ResourceState{
            return (getServerState(_arg1, false));
        }
        public static function getFinalServerState(_arg1:Transaction):ResourceState{
            return (getServerState(_arg1, true));
        }
        private static function getServerState(_arg1:Transaction, _arg2:Boolean):ResourceState{
            var _local3:String = (_arg2) ? "finalState" : "initialState";
            if (!_arg1.rawResult.hasOwnProperty(_local3)){
                return (null);
            };
            var _local4:Object = _arg1.rawResult[_local3];
            var _local5:ResourceState = new (ResourceState)();
            _local5.energy = _local4.energy;
            _local5.gold = _local4.gold;
            _local5.xp = _local4.xp;
            _local5.cash = _local4.cash;
            return (_local5);
        }

        public function equals(_arg1:ResourceState):Boolean{
            if (this.energy != _arg1.energy){
                return (false);
            };
            if (this.gold != _arg1.gold){
                return (false);
            };
            if (this.xp != _arg1.xp){
                return (false);
            };
            if (this.cash != _arg1.cash){
                return (false);
            };
            return (true);
        }
        public function get energy():Number{
            return (this.m_energy);
        }
        public function set energy(_arg1:Number):void{
            this.m_energy = _arg1;
        }
        public function get gold():Number{
            return (this.m_gold);
        }
        public function set gold(_arg1:Number):void{
            this.m_gold = _arg1;
        }
        public function get xp():Number{
            return (this.m_xp);
        }
        public function set xp(_arg1:Number):void{
            this.m_xp = _arg1;
        }
        public function get cash():Number{
            return (this.m_cash);
        }
        public function set cash(_arg1:Number):void{
            this.m_cash = _arg1;
        }

    }
}//package Transactions.tracking 
